from datetime import date
from apscheduler.schedulers.blocking import BlockingScheduler
from dynamic_pricing.pricing_engine import run_pricing

def nightly_update():
    run_pricing()

if __name__ == "__main__":
    sched = BlockingScheduler()
    sched.add_job(nightly_update, 'cron', hour=22, minute=0)
    sched.start()
